//
//  PKBaseViewController.m
//  PianKe
//
//  Created by lanou on 15/9/25.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "PKBaseViewController.h"

@interface PKBaseViewController ()
//左侧按钮
@property(nonatomic,strong)UIButton *leftButton;
@end

@implementation PKBaseViewController
-(UIView *)topView
{
    if (_topView==nil) {
        _topView=[[UIView alloc]initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH,50)];
        [_topView addSubview:self.titleLabel];
        _topView .backgroundColor=[UIColor whiteColor];
        _leftButton=[UIButton buttonWithType:UIButtonTypeSystem];
        _leftButton.backgroundColor=[UIColor purpleColor];
        [_leftButton setTitle:@"三" forState:UIControlStateNormal];
        _leftButton.frame=CGRectMake(5, 10, 30, 30);
        [_leftButton addTarget:self action:@selector(changeViewFrame:)
              forControlEvents:   UIControlEventTouchUpInside ];
        [_topView addSubview:_leftButton];
#warning 周期
        [self.view addSubview:_topView];
    }
    return _topView;
}
-(UILabel *)titileLabel
{
    if (!_titleLabel) {
        _titleLabel=[[UILabel alloc]initWithFrame:CGRectMake(50, 10, 100, 30)];
    }
    return _titleLabel;
}
-(void)changeViewFrame:(UIButton *)sender
{
    //切换视图的位置
    [self.changeFrameVC changeFrame];
    
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSLog(@"%@",self.topView);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
